<?php
class Phongkham extends CI_Controller{
    function  __construct(){
        parent::__construct();
        $this->load->model('mod_phongkham/mmod_phongkham');
        //http://localhost/phongkhamuytin/frontend/phongkham/phongkham/phong-kham-thu-nghiem-gt.html
    }
    function index(){
        $urlpk = $this->uri->segment(2);
        $page = substr($urlpk,-7,-5);
        $alias = substr($urlpk,0,-8);
        if($alias != ''):
            $datapk = $this->home_model->get_one('phongkham',array('alias'=>$alias,'publish'=>1));
            if(empty($datapk)){
                $data['content'] = '<div class="page-erorr"><p style="font-size:15px; font-weight:bold;color:#f00">Phòng khám không tồn tại</p></div>';
            }
            else {
               $data['content'] = $this->load->controller('mod_phongkham',array('data'=>$datapk,'page'=>$page),True);
               //$data['title'] = "Phòng khám uy tín - ".$datapk->title;
           	   //$data['seach']=$this->load->controller('mod_timkiem',array(),True);
               //$this->load->view('frontend/template',$data);
           }
           $data['right']= $this->load->controller('mod_hotrotructuyen',array(),True).
                               $this->load->controller('mod_phongkhamvip',array(),True).
                               $this->load->controller('mod_quangcao',array(),True).
                               $this->load->controller('mod_tintuc_right',array(),True). 
                               $this->load->controller('mod_quangcao',array(),True);    
            $data['title'] = "Phòng khám uy tín ";
            $data['seach']=$this->load->controller('mod_timkiem',array(),True);
            $data['topmenu'] = $this->load->controller('mod_topmenu',array(),true);
            $this->load->view('frontend/template',$data);
       endif;
	}
    
    
}
